# Maintainer: David Runge <dvzrv@archlinux.org>

pkgname=new-session-manager
pkgver=1.6.1
pkgrel=1
pkgdesc="Audio session manager"
arch=(loong64 x86_64)
url="https://github.com/jackaudio/new-session-manager"
license=(GPL3)
depends=(gcc-libs glibc)
makedepends=(fltk jack liblo meson)
optdepends=('fltk: for nsm-legacy-gui')
provides=(non-session-manager)
conflicts=(non-session-manager)
replaces=(non-session-manager)
options=(debug)
source=($pkgname-$pkgver.tar.gz::https://github.com/jackaudio/$pkgname/archive/v$pkgver.tar.gz)
sha512sums=('8efde6a082a4156def3932f1f07775389200186ca64e9ce918ccbaa868893552ec2e4e4cdd085351d4f818a2d6fc73ff182dfc48675b52aa866d3aac563e16a6')
b2sums=('77e4ff869af4735d9c726e1ae6887f18c5ba507a15178a80bd343c5063651f88a6e333496a70800754ff89dae80db5ad312c89abebd5414850e9211fdd014e64')

build() {
  arch-meson build $pkgname-$pkgver
  ninja -C build
}

package() {
  depends+=(libjack.so liblo.so)

  DESTDIR="$pkgdir" meson install -C build
  install -vDm 644 $pkgname-$pkgver/{CHANGELOG,README.md} -t "$pkgdir/usr/share/doc/$pkgname/"
}
